<script>
/*
 * @Author: wzh 
 * @Date: 2020-12-30 22:09:34 
 * @Last Modified by: 1521620993@qq.com
 * @Last Modified time: 2020-12-30 22:17:34
 */
</script>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>03-绝对定位的高度被忽略</title>
</head>
<body>
  <style>
    .box{
      border: 2px solid blue;
    }
    .item1{
      height: 100px;
      width: 100px;
      background-color: red;
      position: absolute;
    }
    .item2{
      height: 50px;
      background-color: brown;
    }
  </style>
  <div class="box">
    <div class="item1"></div>
    <div class="item2"></div>
  </div>
</body>
</html>